package com.it.domain.DTO;

import com.it.domain.Inventory;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

@Data
public class InventoryDTO {
    private Integer inventoryId;
    private Integer productId;
    private Integer quantity;
    private String location;
    private LocalDateTime  updateTime;

    // 静态工厂方法
    public static InventoryDTO fromEntity(Inventory inventory) {
        InventoryDTO dto = new InventoryDTO();
        dto.setInventoryId(inventory.getInventoryId());
        dto.setProductId(inventory.getProductId());
        dto.setQuantity(inventory.getQuantity());
        dto.setLocation(inventory.getLocation());
        dto.setUpdateTime(inventory.getUpdateTime());
        return dto;
    }
}